From: Ivan Molodetskikh Date: Tue, 17 Aug 2021 07:58:23 +0000 (+0300) Subject: status/remote-access: Add menu for stopping screencasts X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~169 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6d0c2ae69772981537613ab5bd7bd706e0445855;p=gnome-shell.git status/remote-access: Add menu for stopping screencasts This is specifically for stopping the screenshot UI screencasts for now. It's possible to stop arbitrary screen recording handles, however due to an issue with pipewiresrc, this method cannot currently work for cleanly stopping Shell's own screen recordings. Hence the best we can do is to handle just the screenshot UI screencasts to let them stop cleanly. Part-of: --- diff --git a/js/ui/status/remoteAccess.js b/js/ui/status/remoteAccess.js index 21f6581b6..d6d500cae 100644 --- a/js/ui/status/remoteAccess.js +++ b/js/ui/status/remoteAccess.js @@ -3,6 +3,7 @@ const { GObject, Meta } = imports.gi; +const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; @@ -50,6 +51,15 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator { this._recordingIndicator = this._addIndicator(); this._recordingIndicator.icon_name = 'media-record-symbolic'; this._recordingIndicator.add_style_class_name('screencast-indicator'); + + this._recordingItem = new PopupMenu.PopupSubMenuMenuItem( + _('Screen Recording in Progress'), + true + ); + this._recordingItem.menu.addAction(_('Stop'), + () => Main.screenshotUI.stopScreencast()); + this._recordingItem.icon.icon_name = 'media-record-symbolic'; + this.menu.addMenuItem(this._recordingItem); } _isScreenShared() { @@ -70,6 +80,7 @@ class RemoteAccessApplet extends PanelMenu.SystemIndicator { } this._recordingIndicator.visible = this._isRecording(); + this._recordingItem.visible = Main.screenshotUI.screencast_in_progress; } _onStopped(handle) {